home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20021006-20030409 / 000376_fdc@columbia.edu_Thu Mar 13 15:22:57 EST 2003.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  63 lines

  1. Article: 14174 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
  3. From: fdc@columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.os.linux.networking,comp.protocols.kermit.misc
  5. Subject: Re: General FTP Questions
  6. Date: 13 Mar 2003 15:00:50 -0500
  7. Organization: Columbia University
  8. Lines: 46
  9. Message-ID: <b4qo1i$6pe$1@watsol.cc.columbia.edu>
  10. References: <3e70e070@snipnews.snip.net>
  11. NNTP-Posting-Host: watsol.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1047585659 27522 128.59.39.139 (13 Mar 2003 20:00:59 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 13 Mar 2003 20:00:59 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.os.linux.networking:416180 comp.protocols.kermit.misc:14174
  16.  
  17. In article <3e70e070@snipnews.snip.net>,
  18. Jason Efting <jefting@vouzi.co.uk> wrote:
  19. : Question 1:
  20. : ------------
  21. : I have a problem where text files uploaded to my FTP server are only
  22. : transmitted partially. In other words if I open the text file I might only
  23. : have half of the actual text inside the file. Is there any way that I can
  24. : prevent this from happening so that I only receive complete files?
  25. : Question 2:
  26. : ------------
  27. : Once a file has been uploaded it to my box a have script takes the file and
  28. : processes it. (The data from the text file is imported into a database and
  29. : the text file is archived.) If I receive a big file the file might still be
  30. : transferring when my script processes the file, this causes some problems.
  31. : (My script will only import the file partially and then archive it.) How can
  32. : I check if the file is complete before I process the file? I through about
  33. : using a cron job to move uploaded files to another directory and then
  34. : process them but I need to process the file immediately once it is uploaded.
  35. : FTP Server: vsFTPd orWU-FTPD
  36. : OS: Redhat Linux 8
  37. Both of these questions are answered here:
  38.  
  39.   http://www.columbia.edu/kermit/ftpscripts.html
  40.  
  41. In both cases, you want to transfer the file to a temporary directory and
  42. then, at the moment the transfer is complete, and only if it was successful,
  43. move it or rename it to a "ready" directory.  This prevents partial or
  44. in-progress files from being treated as if they were complete.  It also
  45. ensures that each file is processed exactly once -- not thrice, not twice,
  46. and not zero times.
  47.  
  48. Clearly you can't force file transfers to always work.  Connections break
  49. sometimes for reasons you can't control.  The best you can do is ensure
  50. that incomplete transfers are sequestered (by the server) where they won't do
  51. any harm and detected and handled (by the client) so it can take corrective
  52. action.  All this is explained in the above reference.
  53.  
  54. Also see:
  55.  
  56.   http://www.columbia.edu/kermit/ftpclient.html
  57.   http://www.columbia.edu/kermit/ckscripts.html#ftp
  58.  
  59. - Frank
  60.